package designpattern.decorator;

/**
 * TODO:类描述
 *
 * @className: Client
 * @packageName: designpattern.decorator
 * @author: Zhuhj
 * @version: V1.0
 * @date: 2021/4/20 21:29
 */
public class Client {
    public static void main(String[] args) {
        Car car = new A1Car();
        Car car1 = new A6Car();
        DecoratorCar decoratorCar1 = new Gps();
        DecoratorCar decoratorCar2 = new Radr();
        DecoratorCar decoratorCar3 = new Gps();

        decoratorCar1.setCar(car);
        decoratorCar2.setCar(decoratorCar1);
        decoratorCar3.setCar(decoratorCar2);
        System.out.println(decoratorCar3.getDesc()+ " cost = " + decoratorCar3.getCost());

    }
}
